package com.gopay.cron.web.controller;

import com.gopay.cron.service.log.CorpLoginLogService;
import com.gopay.cron.service.log.OperLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * @author sh.jiao
 * 存量操作日志 保存到数据库
 */
//@Controller
public class OperLogTransferController {

//    private Logger logger = LoggerFactory.getLogger(this.getClass());
//
//    @Resource(name = "corpLoginLogService")
//    private CorpLoginLogService corpLoginLogService;
//
//    @Resource(name = "operLogService")
//    private OperLogService operLogService;
//
//    @RequestMapping("/log/operLog")
//    public String transferOperLog() {
//        try {
//            long start = System.currentTimeMillis();
//            operLogService.transferLog();
//            logger.error("log数据迁移总耗时：{}ms",(System.currentTimeMillis()-start));
//        } catch (Exception e) {
//            logger.error("log数据迁移失败。",e);
//        }
//        return "index";
//    }
//
//    @RequestMapping("/log/corpLoginLog")
//    public String transferCorpLoginLog() {
//        try {
//            long start = System.currentTimeMillis();
//            corpLoginLogService.transferLog();
//            logger.error("log数据迁移总耗时：{}ms",(System.currentTimeMillis()-start));
//        } catch (Exception e) {
//            logger.error("log数据迁移失败。",e);
//        }
//        return "index";
//    }
}
